/*************************************************
 *	文件名称：test.c
 *	文件说明：测试mydata文件执行情况
 *	程序平台：
 *	文件作者：Jason <jasonsunsoft@163.com>
 *	文件时间：
*************************************************/

#include <stdio.h>
#include "mydata.h"

int main()
{
	SqList La, Lb, Lc;
	ElemType temp;
	int sta;
	sta = InitList_Sq(&La);
	if (!sta)
	{
		printf("InitList_Sq(&La) \n");
		exit(INFEASIBLE);
	}
	sta = InitList_Sq(&Lb);
	if (!sta)
	{
		printf("InitList_Sq(&Lb) \n");
		exit(INFEASIBLE);
	}
	if (ListEmpty_Sq(La));
		printf("La is empty \n");
	ListInsert_Sq(&La, 1, 5);
	if (!ListEmpty_Sq(La));
		printf("ListInsert_Sq OK \n");
	ListInsert_Sq(&La, 2, 7);
	ListInsert_Sq(&La, 3, 21);
	ListInsert_Sq(&Lb, 1, 1);
	ListInsert_Sq(&Lb, 2, 7);
	ListInsert_Sq(&Lb, 3, 23);
	ListTraverse_Sq(La,PrinElem);
	ListTraverse_Sq(Lb,PrinElem);

	ClearList_Sq(&Lb);
	if (ListEmpty_Sq(Lb));
		printf("Lb is empty \n");
	ListInsert_Sq(&Lb, 1, 1);
	ListInsert_Sq(&Lb, 2, 7);
	ListInsert_Sq(&Lb, 3, 23);
	if (ListEmpty_Sq(Lb))
		printf("Lb is empty \n");
	else
		printf("Lb is not empty after ListInsert_Sq\n");
	Union_Sq(&La, &Lb);
	printf("after Union_Sq(&La, &Lb) the La is ");
	ListTraverse_Sq(La,PrinElem);
	printf("\n");

	ListDelete_Sq(&La, 6, &temp);
	ListDelete_Sq(&La, 5, &temp);
	ListDelete_Sq(&La, 4, &temp);
	printf("after ListDelete_Sq temp is %d,la is ",temp);
	ListTraverse_Sq(La,PrinElem);
	printf("\n");

	MergelList_Sq(La, Lb, &Lc);
	printf("after MergelList_Sq Lc is ");
	ListTraverse_Sq(Lc,PrinElem);
	printf("\n");


	return 0;
}
